package cn.jw.starter.common.scheduletask.model;

public class ScheduledTaskInfo<T extends Runnable> {
    private String cronTriggerExpression;
    private final Class<T> runnableClass;
    private final String taskName;

    public ScheduledTaskInfo(String cronTriggerExpression, Class<T> runnableClass, String taskName) {
        this.cronTriggerExpression = cronTriggerExpression;
        this.runnableClass = runnableClass;
        this.taskName = taskName;
    }

    public String getCronTriggerExpression() {
        return cronTriggerExpression;
    }

    public void setCronTriggerExpression(String cronTriggerExpression) {
        this.cronTriggerExpression = cronTriggerExpression;
    }

    public Class<T> getRunnableClass() {
        return runnableClass;
    }

    public String getTaskName() {
        return taskName;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ScheduledTaskInfo{");
        sb.append("cronTriggerExpression='").append(cronTriggerExpression).append('\'');
        sb.append(", runnableClass=").append(runnableClass);
        sb.append(", taskName=").append(taskName);
        sb.append('}');
        return sb.toString();
    }
}
